// 常量路由
export const constantRoute = [
  {
    // 登录
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login',
    meta: {
      title: '登录',
      hidden: true, //代表路由标题在菜单中是否隐藏
    },
    children: [
      {
        path: '/home1',
        component: () => import('@/views/home/index.vue'),
        name: 'home1',
        meta: {
          title: '首页1',
          hidden: false,
        },
        children: [
          {
            path: '/ceshi1',
            component: () => import('@/views/home/index.vue'),
            meta: {
              title: '测试1',
              hidden: false,
            },
          },
        ],
      },
    ],
  },
  {
    // 登录成功展示数据（一级路由）
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: 'layout',
      hidden: false,
    },
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        name: 'home',
        meta: {
          title: '首页',
          hidden: false,
        },
      },
      {
        path: '/ceshi',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '测试',
          hidden: false,
        },
      },
    ],
  },
  {
    // 404
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    // 任意路由，上面没匹配到自动重定向
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
      title: '任意路由',
      hidden: true,
    },
  },
];
